//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Textract {
    // MARK: Enums

    public enum AdapterVersionStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case active = "ACTIVE"
        case atRisk = "AT_RISK"
        case creationError = "CREATION_ERROR"
        case creationInProgress = "CREATION_IN_PROGRESS"
        case deprecated = "DEPRECATED"
        public var description: String { return self.rawValue }
    }

    public enum AutoUpdate: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum BlockType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cell = "CELL"
        case keyValueSet = "KEY_VALUE_SET"
        case layoutFigure = "LAYOUT_FIGURE"
        case layoutFooter = "LAYOUT_FOOTER"
        case layoutHeader = "LAYOUT_HEADER"
        case layoutKeyValue = "LAYOUT_KEY_VALUE"
        case layoutList = "LAYOUT_LIST"
        case layoutPageNumber = "LAYOUT_PAGE_NUMBER"
        case layoutSectionHeader = "LAYOUT_SECTION_HEADER"
        case layoutTable = "LAYOUT_TABLE"
        case layoutText = "LAYOUT_TEXT"
        case layoutTitle = "LAYOUT_TITLE"
        case line = "LINE"
        case mergedCell = "MERGED_CELL"
        case page = "PAGE"
        case query = "QUERY"
        case queryResult = "QUERY_RESULT"
        case selectionElement = "SELECTION_ELEMENT"
        case signature = "SIGNATURE"
        case table = "TABLE"
        case tableFooter = "TABLE_FOOTER"
        case tableTitle = "TABLE_TITLE"
        case title = "TITLE"
        case word = "WORD"
        public var description: String { return self.rawValue }
    }

    public enum ContentClassifier: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case freeOfAdultContent = "FreeOfAdultContent"
        case freeOfPersonallyIdentifiableInformation = "FreeOfPersonallyIdentifiableInformation"
        public var description: String { return self.rawValue }
    }

    public enum EntityType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case columnHeader = "COLUMN_HEADER"
        case key = "KEY"
        case semiStructuredTable = "SEMI_STRUCTURED_TABLE"
        case structuredTable = "STRUCTURED_TABLE"
        case tableFooter = "TABLE_FOOTER"
        case tableSectionTitle = "TABLE_SECTION_TITLE"
        case tableSummary = "TABLE_SUMMARY"
        case tableTitle = "TABLE_TITLE"
        case value = "VALUE"
        public var description: String { return self.rawValue }
    }

    public enum FeatureType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case forms = "FORMS"
        case layout = "LAYOUT"
        case queries = "QUERIES"
        case signatures = "SIGNATURES"
        case tables = "TABLES"
        public var description: String { return self.rawValue }
    }

    public enum JobStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        case partialSuccess = "PARTIAL_SUCCESS"
        case succeeded = "SUCCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum RelationshipType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case answer = "ANSWER"
        case child = "CHILD"
        case complexFeatures = "COMPLEX_FEATURES"
        case mergedCell = "MERGED_CELL"
        case table = "TABLE"
        case tableFooter = "TABLE_FOOTER"
        case tableTitle = "TABLE_TITLE"
        case title = "TITLE"
        case value = "VALUE"
        public var description: String { return self.rawValue }
    }

    public enum SelectionStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case notSelected = "NOT_SELECTED"
        case selected = "SELECTED"
        public var description: String { return self.rawValue }
    }

    public enum TextType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case handwriting = "HANDWRITING"
        case printed = "PRINTED"
        public var description: String { return self.rawValue }
    }

    public enum ValueType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case date = "Date"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessDeniedException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct Adapter: AWSEncodableShape {
        /// A unique identifier for the adapter resource.
        public let adapterId: String
        /// Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a  list of rules for using this parameter.   If a page is not specified, it is set to ["1"] by default.   The following characters are allowed in the parameter's string:  0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed.   When using * to indicate all pages, it must be the only element in the list.   You can use page intervals, such as ["1-3", "1-1", "4-*"]. Where * indicates last page of  document.   Specified pages must be greater than 0 and less than or equal to the number of pages in the document.
        public let pages: [String]?
        /// A string that identifies the version of the adapter.
        public let version: String

        @inlinable
        public init(adapterId: String, pages: [String]? = nil, version: String) {
            self.adapterId = adapterId
            self.pages = pages
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.pages?.forEach {
                try validate($0, name: "pages[]", parent: name, max: 9)
                try validate($0, name: "pages[]", parent: name, min: 1)
                try validate($0, name: "pages[]", parent: name, pattern: "^[0-9\\*\\-]+$")
            }
            try self.validate(self.pages, name: "pages", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 128)
            try self.validate(self.version, name: "version", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case pages = "Pages"
            case version = "Version"
        }
    }

    public struct AdapterOverview: AWSDecodableShape {
        /// A unique identifier for the adapter resource.
        public let adapterId: String?
        /// A string naming the adapter resource.
        public let adapterName: String?
        /// The date and time that the adapter was created.
        public let creationTime: Date?
        /// The feature types that the adapter is operating on.
        public let featureTypes: [FeatureType]?

        @inlinable
        public init(adapterId: String? = nil, adapterName: String? = nil, creationTime: Date? = nil, featureTypes: [FeatureType]? = nil) {
            self.adapterId = adapterId
            self.adapterName = adapterName
            self.creationTime = creationTime
            self.featureTypes = featureTypes
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterName = "AdapterName"
            case creationTime = "CreationTime"
            case featureTypes = "FeatureTypes"
        }
    }

    public struct AdapterVersionDatasetConfig: AWSEncodableShape & AWSDecodableShape {
        public let manifestS3Object: S3Object?

        @inlinable
        public init(manifestS3Object: S3Object? = nil) {
            self.manifestS3Object = manifestS3Object
        }

        public func validate(name: String) throws {
            try self.manifestS3Object?.validate(name: "\(name).manifestS3Object")
        }

        private enum CodingKeys: String, CodingKey {
            case manifestS3Object = "ManifestS3Object"
        }
    }

    public struct AdapterVersionEvaluationMetric: AWSDecodableShape {
        /// The F1 score, precision, and recall metrics for the baseline model.
        public let adapterVersion: EvaluationMetric?
        /// The F1 score, precision, and recall metrics for the baseline model.
        public let baseline: EvaluationMetric?
        /// Indicates the feature type being analyzed by a given adapter version.
        public let featureType: FeatureType?

        @inlinable
        public init(adapterVersion: EvaluationMetric? = nil, baseline: EvaluationMetric? = nil, featureType: FeatureType? = nil) {
            self.adapterVersion = adapterVersion
            self.baseline = baseline
            self.featureType = featureType
        }

        private enum CodingKeys: String, CodingKey {
            case adapterVersion = "AdapterVersion"
            case baseline = "Baseline"
            case featureType = "FeatureType"
        }
    }

    public struct AdapterVersionOverview: AWSDecodableShape {
        /// A unique identifier for the adapter associated with a given adapter version.
        public let adapterId: String?
        /// An identified for a given adapter version.
        public let adapterVersion: String?
        /// The date and time that a given adapter version was created.
        public let creationTime: Date?
        /// The feature types that the adapter version is operating on.
        public let featureTypes: [FeatureType]?
        /// Contains information on the status of a given adapter version.
        public let status: AdapterVersionStatus?
        /// A message explaining the status of a given adapter vesion.
        public let statusMessage: String?

        @inlinable
        public init(adapterId: String? = nil, adapterVersion: String? = nil, creationTime: Date? = nil, featureTypes: [FeatureType]? = nil, status: AdapterVersionStatus? = nil, statusMessage: String? = nil) {
            self.adapterId = adapterId
            self.adapterVersion = adapterVersion
            self.creationTime = creationTime
            self.featureTypes = featureTypes
            self.status = status
            self.statusMessage = statusMessage
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterVersion = "AdapterVersion"
            case creationTime = "CreationTime"
            case featureTypes = "FeatureTypes"
            case status = "Status"
            case statusMessage = "StatusMessage"
        }
    }

    public struct AdaptersConfig: AWSEncodableShape {
        /// A list of adapters to be used when analyzing the specified document.
        public let adapters: [Adapter]

        @inlinable
        public init(adapters: [Adapter]) {
            self.adapters = adapters
        }

        public func validate(name: String) throws {
            try self.adapters.forEach {
                try $0.validate(name: "\(name).adapters[]")
            }
            try self.validate(self.adapters, name: "adapters", parent: name, max: 100)
            try self.validate(self.adapters, name: "adapters", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case adapters = "Adapters"
        }
    }

    public struct AnalyzeDocumentRequest: AWSEncodableShape {
        /// Specifies the adapter to be used when analyzing a document.
        public let adaptersConfig: AdaptersConfig?
        /// The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format. If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the Bytes field.
        public let document: Document
        /// A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document.  All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).
        public let featureTypes: [FeatureType]
        /// Sets the configuration for the human in the loop workflow for analyzing documents.
        public let humanLoopConfig: HumanLoopConfig?
        /// Contains Queries and the alias for those Queries, as determined by the input.
        public let queriesConfig: QueriesConfig?

        @inlinable
        public init(adaptersConfig: AdaptersConfig? = nil, document: Document, featureTypes: [FeatureType], humanLoopConfig: HumanLoopConfig? = nil, queriesConfig: QueriesConfig? = nil) {
            self.adaptersConfig = adaptersConfig
            self.document = document
            self.featureTypes = featureTypes
            self.humanLoopConfig = humanLoopConfig
            self.queriesConfig = queriesConfig
        }

        public func validate(name: String) throws {
            try self.adaptersConfig?.validate(name: "\(name).adaptersConfig")
            try self.document.validate(name: "\(name).document")
            try self.humanLoopConfig?.validate(name: "\(name).humanLoopConfig")
            try self.queriesConfig?.validate(name: "\(name).queriesConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case adaptersConfig = "AdaptersConfig"
            case document = "Document"
            case featureTypes = "FeatureTypes"
            case humanLoopConfig = "HumanLoopConfig"
            case queriesConfig = "QueriesConfig"
        }
    }

    public struct AnalyzeDocumentResponse: AWSDecodableShape {
        /// The version of the model used to analyze the document.
        public let analyzeDocumentModelVersion: String?
        /// The items that are detected and analyzed by AnalyzeDocument.
        public let blocks: [Block]?
        /// Metadata about the analyzed document. An example is the number of pages.
        public let documentMetadata: DocumentMetadata?
        /// Shows the results of the human in the loop evaluation.
        public let humanLoopActivationOutput: HumanLoopActivationOutput?

        @inlinable
        public init(analyzeDocumentModelVersion: String? = nil, blocks: [Block]? = nil, documentMetadata: DocumentMetadata? = nil, humanLoopActivationOutput: HumanLoopActivationOutput? = nil) {
            self.analyzeDocumentModelVersion = analyzeDocumentModelVersion
            self.blocks = blocks
            self.documentMetadata = documentMetadata
            self.humanLoopActivationOutput = humanLoopActivationOutput
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeDocumentModelVersion = "AnalyzeDocumentModelVersion"
            case blocks = "Blocks"
            case documentMetadata = "DocumentMetadata"
            case humanLoopActivationOutput = "HumanLoopActivationOutput"
        }
    }

    public struct AnalyzeExpenseRequest: AWSEncodableShape {
        public let document: Document

        @inlinable
        public init(document: Document) {
            self.document = document
        }

        public func validate(name: String) throws {
            try self.document.validate(name: "\(name).document")
        }

        private enum CodingKeys: String, CodingKey {
            case document = "Document"
        }
    }

    public struct AnalyzeExpenseResponse: AWSDecodableShape {
        public let documentMetadata: DocumentMetadata?
        /// The expenses detected by Amazon Textract.
        public let expenseDocuments: [ExpenseDocument]?

        @inlinable
        public init(documentMetadata: DocumentMetadata? = nil, expenseDocuments: [ExpenseDocument]? = nil) {
            self.documentMetadata = documentMetadata
            self.expenseDocuments = expenseDocuments
        }

        private enum CodingKeys: String, CodingKey {
            case documentMetadata = "DocumentMetadata"
            case expenseDocuments = "ExpenseDocuments"
        }
    }

    public struct AnalyzeIDDetections: AWSDecodableShape {
        /// The confidence score of the detected text.
        public let confidence: Float?
        /// Only returned for dates, returns the type of value detected and the date written in a more machine readable way.
        public let normalizedValue: NormalizedValue?
        /// Text of either the normalized field or value associated with it.
        public let text: String

        @inlinable
        public init(confidence: Float? = nil, normalizedValue: NormalizedValue? = nil, text: String) {
            self.confidence = confidence
            self.normalizedValue = normalizedValue
            self.text = text
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case normalizedValue = "NormalizedValue"
            case text = "Text"
        }
    }

    public struct AnalyzeIDRequest: AWSEncodableShape {
        /// The document being passed to AnalyzeID.
        public let documentPages: [Document]

        @inlinable
        public init(documentPages: [Document]) {
            self.documentPages = documentPages
        }

        public func validate(name: String) throws {
            try self.documentPages.forEach {
                try $0.validate(name: "\(name).documentPages[]")
            }
            try self.validate(self.documentPages, name: "documentPages", parent: name, max: 2)
            try self.validate(self.documentPages, name: "documentPages", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case documentPages = "DocumentPages"
        }
    }

    public struct AnalyzeIDResponse: AWSDecodableShape {
        /// The version of the AnalyzeIdentity API being used to process documents.
        public let analyzeIDModelVersion: String?
        public let documentMetadata: DocumentMetadata?
        /// The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.
        public let identityDocuments: [IdentityDocument]?

        @inlinable
        public init(analyzeIDModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil, identityDocuments: [IdentityDocument]? = nil) {
            self.analyzeIDModelVersion = analyzeIDModelVersion
            self.documentMetadata = documentMetadata
            self.identityDocuments = identityDocuments
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeIDModelVersion = "AnalyzeIDModelVersion"
            case documentMetadata = "DocumentMetadata"
            case identityDocuments = "IdentityDocuments"
        }
    }

    public struct BadDocumentException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct Block: AWSDecodableShape {
        /// The type of text item that's recognized. In operations for text detection, the following types are returned:    PAGE - Contains a list of the LINE Block objects that are detected on a document page.    WORD - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.    LINE - A string of space-delimited, contiguous words that are detected on a document page.   In text analysis operations, the following types are returned:    PAGE - Contains a list of child Block objects that are detected on a document page.    KEY_VALUE_SET - Stores the KEY and VALUE Block objects for linked text that's detected on a document page. Use the EntityType field to determine if a KEY_VALUE_SET object is a KEY Block object or a VALUE Block object.     WORD - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.    LINE - A string of tab-delimited, contiguous words that are detected on a document page.    TABLE - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each.     TABLE_TITLE - The title of a table. A title is typically a line of text above or below a table, or embedded as the first row of a table.     TABLE_FOOTER - The footer associated with a table. A footer is typically a line or lines of text below a table or embedded as the last row of a table.     CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.    MERGED_CELL  - A cell in a table whose content spans more than one row or column. The Relationships array for this cell contain data from individual cells.    SELECTION_ELEMENT - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of SelectionStatus to determine the status of the selection element.    SIGNATURE - The location and confidence score of a signature detected on a document page. Can be returned as part of a Key-Value pair or a detected cell.    QUERY - A question asked during the call of AnalyzeDocument. Contains an alias and an ID that attaches it to its answer.    QUERY_RESULT - A response to a question asked during the call of analyze document. Comes with an alias and ID for ease of locating in a  response. Also contains location and confidence score.   The following BlockTypes are only returned for Amazon Textract Layout.    LAYOUT_TITLE - The main title of the document.    LAYOUT_HEADER - Text located in the top margin of the document.    LAYOUT_FOOTER - Text located in the bottom margin of the document.    LAYOUT_SECTION_HEADER - The titles of sections within a document.    LAYOUT_PAGE_NUMBER - The page number of the documents.    LAYOUT_LIST - Any information grouped together in list form.     LAYOUT_FIGURE - Indicates the location of an image in a document.    LAYOUT_TABLE - Indicates the location of a table in the document.    LAYOUT_KEY_VALUE - Indicates the location of form key-values in a document.    LAYOUT_TEXT - Text that is present typically as a part of paragraphs in documents.
        public let blockType: BlockType?
        /// The column in which a table cell appears. The first column position is 1. ColumnIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.
        public let columnIndex: Int?
        /// The number of columns that a table cell spans. ColumnSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.
        public let columnSpan: Int?
        /// The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.
        public let confidence: Float?
        /// The type of entity.  The following entity types can be returned by FORMS analysis:    KEY - An identifier for a field on the document.    VALUE - The field text.   The following entity types can be returned by TABLES analysis:    COLUMN_HEADER - Identifies a cell that is a header of a column.     TABLE_TITLE - Identifies a cell that is a title within the table.     TABLE_SECTION_TITLE - Identifies a cell that is a title of a section within a table. A section title is a cell that typically spans an entire row above a section.     TABLE_FOOTER - Identifies a cell that is a footer of a table.     TABLE_SUMMARY - Identifies a summary cell of a table. A summary cell can be a row of a table or an additional, smaller table that contains summary information for another table.     STRUCTURED_TABLE  - Identifies a table with column headers where the content of each row corresponds to the headers.     SEMI_STRUCTURED_TABLE - Identifies a non-structured table.     EntityTypes isn't returned by DetectDocumentText and GetDocumentTextDetection.
        public let entityTypes: [EntityType]?
        /// The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information.
        public let geometry: Geometry?
        /// The identifier for the recognized text. The identifier is only unique for a single operation.
        public let id: String?
        /// The page on which a block was detected. Page is returned by synchronous and asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG) provided to an asynchronous operation, even if it contains multiple document pages, is considered a single-page document. This means that for scanned images the value of Page is always 1.
        public let page: Int?
        public let query: Query?
        /// A list of relationship objects that describe how blocks are related to each other. For example, a LINE block object contains a CHILD relationship type with the WORD blocks that make up the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks.
        public let relationships: [Relationship]?
        /// The row in which a table cell is located. The first row position is 1. RowIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.
        public let rowIndex: Int?
        /// The number of rows that a table cell spans. RowSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.
        public let rowSpan: Int?
        /// The selection status of a selection element, such as an option button or check box.
        public let selectionStatus: SelectionStatus?
        /// The word or line of text that's recognized by Amazon Textract.
        public let text: String?
        /// The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.
        public let textType: TextType?

        @inlinable
        public init(blockType: BlockType? = nil, columnIndex: Int? = nil, columnSpan: Int? = nil, confidence: Float? = nil, entityTypes: [EntityType]? = nil, geometry: Geometry? = nil, id: String? = nil, page: Int? = nil, query: Query? = nil, relationships: [Relationship]? = nil, rowIndex: Int? = nil, rowSpan: Int? = nil, selectionStatus: SelectionStatus? = nil, text: String? = nil, textType: TextType? = nil) {
            self.blockType = blockType
            self.columnIndex = columnIndex
            self.columnSpan = columnSpan
            self.confidence = confidence
            self.entityTypes = entityTypes
            self.geometry = geometry
            self.id = id
            self.page = page
            self.query = query
            self.relationships = relationships
            self.rowIndex = rowIndex
            self.rowSpan = rowSpan
            self.selectionStatus = selectionStatus
            self.text = text
            self.textType = textType
        }

        private enum CodingKeys: String, CodingKey {
            case blockType = "BlockType"
            case columnIndex = "ColumnIndex"
            case columnSpan = "ColumnSpan"
            case confidence = "Confidence"
            case entityTypes = "EntityTypes"
            case geometry = "Geometry"
            case id = "Id"
            case page = "Page"
            case query = "Query"
            case relationships = "Relationships"
            case rowIndex = "RowIndex"
            case rowSpan = "RowSpan"
            case selectionStatus = "SelectionStatus"
            case text = "Text"
            case textType = "TextType"
        }
    }

    public struct BoundingBox: AWSDecodableShape {
        /// The height of the bounding box as a ratio of the overall document page height.
        public let height: Float?
        /// The left coordinate of the bounding box as a ratio of overall document page width.
        public let left: Float?
        /// The top coordinate of the bounding box as a ratio of overall document page height.
        public let top: Float?
        /// The width of the bounding box as a ratio of the overall document page width.
        public let width: Float?

        @inlinable
        public init(height: Float? = nil, left: Float? = nil, top: Float? = nil, width: Float? = nil) {
            self.height = height
            self.left = left
            self.top = top
            self.width = width
        }

        private enum CodingKeys: String, CodingKey {
            case height = "Height"
            case left = "Left"
            case top = "Top"
            case width = "Width"
        }
    }

    public struct ConflictException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct CreateAdapterRequest: AWSEncodableShape {
        /// The name to be assigned to the adapter being created.
        public let adapterName: String
        /// Controls whether or not the adapter should automatically update.
        public let autoUpdate: AutoUpdate?
        /// Idempotent token is used to recognize the request. If the same token is used with multiple  CreateAdapter requests, the same session is returned.  This token is employed to avoid unintentionally creating the same session multiple times.
        public let clientRequestToken: String?
        /// The description to be assigned to the adapter being created.
        public let description: String?
        /// The type of feature that the adapter is being trained on. Currrenly, supported feature types are: QUERIES
        public let featureTypes: [FeatureType]
        /// A list of tags to be added to the adapter.
        public let tags: [String: String]?

        @inlinable
        public init(adapterName: String, autoUpdate: AutoUpdate? = nil, clientRequestToken: String? = CreateAdapterRequest.idempotencyToken(), description: String? = nil, featureTypes: [FeatureType], tags: [String: String]? = nil) {
            self.adapterName = adapterName
            self.autoUpdate = autoUpdate
            self.clientRequestToken = clientRequestToken
            self.description = description
            self.featureTypes = featureTypes
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterName, name: "adapterName", parent: name, max: 128)
            try self.validate(self.adapterName, name: "adapterName", parent: name, min: 1)
            try self.validate(self.adapterName, name: "adapterName", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, pattern: "^[a-zA-Z0-9\\s!\"\\#\\$%'&\\(\\)\\*\\+\\,\\-\\./:;=\\?@\\[\\\\\\]\\^_`\\{\\|\\}~><]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterName = "AdapterName"
            case autoUpdate = "AutoUpdate"
            case clientRequestToken = "ClientRequestToken"
            case description = "Description"
            case featureTypes = "FeatureTypes"
            case tags = "Tags"
        }
    }

    public struct CreateAdapterResponse: AWSDecodableShape {
        /// A string containing the unique ID for the adapter that has been created.
        public let adapterId: String?

        @inlinable
        public init(adapterId: String? = nil) {
            self.adapterId = adapterId
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
        }
    }

    public struct CreateAdapterVersionRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter that will receive a new version.
        public let adapterId: String
        /// Idempotent token is used to recognize the request. If the same token is used with multiple  CreateAdapterVersion requests, the same session is returned.  This token is employed to avoid unintentionally creating the same session multiple times.
        public let clientRequestToken: String?
        /// Specifies a dataset used to train a new adapter version. Takes a ManifestS3Object as the value.
        public let datasetConfig: AdapterVersionDatasetConfig
        /// The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.
        public let kmsKeyId: String?
        public let outputConfig: OutputConfig
        /// A set of tags (key-value pairs) that you want to attach to the adapter version.
        public let tags: [String: String]?

        @inlinable
        public init(adapterId: String, clientRequestToken: String? = CreateAdapterVersionRequest.idempotencyToken(), datasetConfig: AdapterVersionDatasetConfig, kmsKeyId: String? = nil, outputConfig: OutputConfig, tags: [String: String]? = nil) {
            self.adapterId = adapterId
            self.clientRequestToken = clientRequestToken
            self.datasetConfig = datasetConfig
            self.kmsKeyId = kmsKeyId
            self.outputConfig = outputConfig
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.datasetConfig.validate(name: "\(name).datasetConfig")
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, max: 2048)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, min: 1)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, pattern: "^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$")
            try self.outputConfig.validate(name: "\(name).outputConfig")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case clientRequestToken = "ClientRequestToken"
            case datasetConfig = "DatasetConfig"
            case kmsKeyId = "KMSKeyId"
            case outputConfig = "OutputConfig"
            case tags = "Tags"
        }
    }

    public struct CreateAdapterVersionResponse: AWSDecodableShape {
        /// A string containing the unique ID for the adapter that has received a new version.
        public let adapterId: String?
        /// A string describing the new version of the adapter.
        public let adapterVersion: String?

        @inlinable
        public init(adapterId: String? = nil, adapterVersion: String? = nil) {
            self.adapterId = adapterId
            self.adapterVersion = adapterVersion
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterVersion = "AdapterVersion"
        }
    }

    public struct DeleteAdapterRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter to be deleted.
        public let adapterId: String

        @inlinable
        public init(adapterId: String) {
            self.adapterId = adapterId
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
        }
    }

    public struct DeleteAdapterResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteAdapterVersionRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter version that will be deleted.
        public let adapterId: String
        /// Specifies the adapter version to be deleted.
        public let adapterVersion: String

        @inlinable
        public init(adapterId: String, adapterVersion: String) {
            self.adapterId = adapterId
            self.adapterVersion = adapterVersion
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.validate(self.adapterVersion, name: "adapterVersion", parent: name, max: 128)
            try self.validate(self.adapterVersion, name: "adapterVersion", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterVersion = "AdapterVersion"
        }
    }

    public struct DeleteAdapterVersionResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DetectDocumentTextRequest: AWSEncodableShape {
        /// The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image  in JPEG or PNG format. If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the Bytes field.
        public let document: Document

        @inlinable
        public init(document: Document) {
            self.document = document
        }

        public func validate(name: String) throws {
            try self.document.validate(name: "\(name).document")
        }

        private enum CodingKeys: String, CodingKey {
            case document = "Document"
        }
    }

    public struct DetectDocumentTextResponse: AWSDecodableShape {
        /// An array of Block objects that contain the text that's detected in the document.
        public let blocks: [Block]?
        public let detectDocumentTextModelVersion: String?
        /// Metadata about the document. It contains the number of pages that are detected in the document.
        public let documentMetadata: DocumentMetadata?

        @inlinable
        public init(blocks: [Block]? = nil, detectDocumentTextModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil) {
            self.blocks = blocks
            self.detectDocumentTextModelVersion = detectDocumentTextModelVersion
            self.documentMetadata = documentMetadata
        }

        private enum CodingKeys: String, CodingKey {
            case blocks = "Blocks"
            case detectDocumentTextModelVersion = "DetectDocumentTextModelVersion"
            case documentMetadata = "DocumentMetadata"
        }
    }

    public struct DetectedSignature: AWSDecodableShape {
        /// The page a detected signature was found on.
        public let page: Int?

        @inlinable
        public init(page: Int? = nil) {
            self.page = page
        }

        private enum CodingKeys: String, CodingKey {
            case page = "Page"
        }
    }

    public struct Document: AWSEncodableShape {
        /// A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format. If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.
        public let bytes: AWSBase64Data?
        /// Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.
        public let s3Object: S3Object?

        @inlinable
        public init(bytes: AWSBase64Data? = nil, s3Object: S3Object? = nil) {
            self.bytes = bytes
            self.s3Object = s3Object
        }

        public func validate(name: String) throws {
            try self.validate(self.bytes, name: "bytes", parent: name, max: 10485760)
            try self.validate(self.bytes, name: "bytes", parent: name, min: 1)
            try self.s3Object?.validate(name: "\(name).s3Object")
        }

        private enum CodingKeys: String, CodingKey {
            case bytes = "Bytes"
            case s3Object = "S3Object"
        }
    }

    public struct DocumentGroup: AWSDecodableShape {
        /// A list of the detected signatures found in a document group.
        public let detectedSignatures: [DetectedSignature]?
        /// An array that contains information about the pages of a document, defined by logical boundary.
        public let splitDocuments: [SplitDocument]?
        /// The type of document that Amazon Textract has detected. See Analyze Lending Response Objects for a list of all types returned by Textract.
        public let type: String?
        /// A list of any expected signatures not found in a document group.
        public let undetectedSignatures: [UndetectedSignature]?

        @inlinable
        public init(detectedSignatures: [DetectedSignature]? = nil, splitDocuments: [SplitDocument]? = nil, type: String? = nil, undetectedSignatures: [UndetectedSignature]? = nil) {
            self.detectedSignatures = detectedSignatures
            self.splitDocuments = splitDocuments
            self.type = type
            self.undetectedSignatures = undetectedSignatures
        }

        private enum CodingKeys: String, CodingKey {
            case detectedSignatures = "DetectedSignatures"
            case splitDocuments = "SplitDocuments"
            case type = "Type"
            case undetectedSignatures = "UndetectedSignatures"
        }
    }

    public struct DocumentLocation: AWSEncodableShape {
        /// The Amazon S3 bucket that contains the input document.
        public let s3Object: S3Object?

        @inlinable
        public init(s3Object: S3Object? = nil) {
            self.s3Object = s3Object
        }

        public func validate(name: String) throws {
            try self.s3Object?.validate(name: "\(name).s3Object")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Object = "S3Object"
        }
    }

    public struct DocumentMetadata: AWSDecodableShape {
        /// The number of pages that are detected in the document.
        public let pages: Int?

        @inlinable
        public init(pages: Int? = nil) {
            self.pages = pages
        }

        private enum CodingKeys: String, CodingKey {
            case pages = "Pages"
        }
    }

    public struct DocumentTooLargeException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct EvaluationMetric: AWSDecodableShape {
        /// The F1 score for an adapter version.
        public let f1Score: Float?
        /// The Precision score for an adapter version.
        public let precision: Float?
        /// The Recall score for an adapter version.
        public let recall: Float?

        @inlinable
        public init(f1Score: Float? = nil, precision: Float? = nil, recall: Float? = nil) {
            self.f1Score = f1Score
            self.precision = precision
            self.recall = recall
        }

        private enum CodingKeys: String, CodingKey {
            case f1Score = "F1Score"
            case precision = "Precision"
            case recall = "Recall"
        }
    }

    public struct ExpenseCurrency: AWSDecodableShape {
        /// Currency code for detected currency. the current supported codes are:   USD   EUR   GBP   CAD   INR   JPY   CHF   AUD   CNY   BZR   SEK   HKD
        public let code: String?
        /// Percentage confideence in the detected currency.
        public let confidence: Float?

        @inlinable
        public init(code: String? = nil, confidence: Float? = nil) {
            self.code = code
            self.confidence = confidence
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case confidence = "Confidence"
        }
    }

    public struct ExpenseDetection: AWSDecodableShape {
        /// The confidence in detection, as a percentage
        public let confidence: Float?
        public let geometry: Geometry?
        /// The word or line of text recognized by Amazon Textract
        public let text: String?

        @inlinable
        public init(confidence: Float? = nil, geometry: Geometry? = nil, text: String? = nil) {
            self.confidence = confidence
            self.geometry = geometry
            self.text = text
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case geometry = "Geometry"
            case text = "Text"
        }
    }

    public struct ExpenseDocument: AWSDecodableShape {
        /// This is a block object, the same as reported when DetectDocumentText is run on a document. It provides word level recognition of text.
        public let blocks: [Block]?
        /// Denotes which invoice or receipt in the document the information is coming from.  First document will be 1, the second 2, and so on.
        public let expenseIndex: Int?
        /// Information detected on each table of a document, seperated into LineItems.
        public let lineItemGroups: [LineItemGroup]?
        /// Any information found outside of a table by Amazon Textract.
        public let summaryFields: [ExpenseField]?

        @inlinable
        public init(blocks: [Block]? = nil, expenseIndex: Int? = nil, lineItemGroups: [LineItemGroup]? = nil, summaryFields: [ExpenseField]? = nil) {
            self.blocks = blocks
            self.expenseIndex = expenseIndex
            self.lineItemGroups = lineItemGroups
            self.summaryFields = summaryFields
        }

        private enum CodingKeys: String, CodingKey {
            case blocks = "Blocks"
            case expenseIndex = "ExpenseIndex"
            case lineItemGroups = "LineItemGroups"
            case summaryFields = "SummaryFields"
        }
    }

    public struct ExpenseField: AWSDecodableShape {
        /// Shows the kind of currency, both the code and confidence associated with any monatary value detected.
        public let currency: ExpenseCurrency?
        /// Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.
        public let groupProperties: [ExpenseGroupProperty]?
        /// The explicitly stated label of a detected element.
        public let labelDetection: ExpenseDetection?
        /// The page number the value was detected on.
        public let pageNumber: Int?
        /// The implied label of a detected element. Present alongside LabelDetection for explicit elements.
        public let type: ExpenseType?
        /// The value of a detected element. Present in explicit and implicit elements.
        public let valueDetection: ExpenseDetection?

        @inlinable
        public init(currency: ExpenseCurrency? = nil, groupProperties: [ExpenseGroupProperty]? = nil, labelDetection: ExpenseDetection? = nil, pageNumber: Int? = nil, type: ExpenseType? = nil, valueDetection: ExpenseDetection? = nil) {
            self.currency = currency
            self.groupProperties = groupProperties
            self.labelDetection = labelDetection
            self.pageNumber = pageNumber
            self.type = type
            self.valueDetection = valueDetection
        }

        private enum CodingKeys: String, CodingKey {
            case currency = "Currency"
            case groupProperties = "GroupProperties"
            case labelDetection = "LabelDetection"
            case pageNumber = "PageNumber"
            case type = "Type"
            case valueDetection = "ValueDetection"
        }
    }

    public struct ExpenseGroupProperty: AWSDecodableShape {
        /// Provides a group Id number, which will be the same for each in the group.
        public let id: String?
        /// Informs you on whether the expense group is a name or an address.
        public let types: [String]?

        @inlinable
        public init(id: String? = nil, types: [String]? = nil) {
            self.id = id
            self.types = types
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case types = "Types"
        }
    }

    public struct ExpenseType: AWSDecodableShape {
        /// The confidence of accuracy, as a percentage.
        public let confidence: Float?
        /// The word or line of text detected by Amazon Textract.
        public let text: String?

        @inlinable
        public init(confidence: Float? = nil, text: String? = nil) {
            self.confidence = confidence
            self.text = text
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case text = "Text"
        }
    }

    public struct Extraction: AWSDecodableShape {
        public let expenseDocument: ExpenseDocument?
        public let identityDocument: IdentityDocument?
        /// Holds the structured data returned by AnalyzeDocument for lending documents.
        public let lendingDocument: LendingDocument?

        @inlinable
        public init(expenseDocument: ExpenseDocument? = nil, identityDocument: IdentityDocument? = nil, lendingDocument: LendingDocument? = nil) {
            self.expenseDocument = expenseDocument
            self.identityDocument = identityDocument
            self.lendingDocument = lendingDocument
        }

        private enum CodingKeys: String, CodingKey {
            case expenseDocument = "ExpenseDocument"
            case identityDocument = "IdentityDocument"
            case lendingDocument = "LendingDocument"
        }
    }

    public struct Geometry: AWSDecodableShape {
        /// An axis-aligned coarse representation of the location of the recognized item on the document page.
        public let boundingBox: BoundingBox?
        /// Within the bounding box, a fine-grained polygon around the recognized item.
        public let polygon: [Point]?
        /// Provides a numerical value corresponding to the rotation of the text.
        public let rotationAngle: Float?

        @inlinable
        public init(boundingBox: BoundingBox? = nil, polygon: [Point]? = nil, rotationAngle: Float? = nil) {
            self.boundingBox = boundingBox
            self.polygon = polygon
            self.rotationAngle = rotationAngle
        }

        private enum CodingKeys: String, CodingKey {
            case boundingBox = "BoundingBox"
            case polygon = "Polygon"
            case rotationAngle = "RotationAngle"
        }
    }

    public struct GetAdapterRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter.
        public let adapterId: String

        @inlinable
        public init(adapterId: String) {
            self.adapterId = adapterId
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
        }
    }

    public struct GetAdapterResponse: AWSDecodableShape {
        /// A string identifying the adapter that information has been retrieved for.
        public let adapterId: String?
        /// The name of the requested adapter.
        public let adapterName: String?
        /// Binary value indicating if the adapter is being automatically updated or not.
        public let autoUpdate: AutoUpdate?
        /// The date and time the requested adapter was created at.
        public let creationTime: Date?
        /// The description for the requested adapter.
        public let description: String?
        /// List of the targeted feature types for the requested adapter.
        public let featureTypes: [FeatureType]?
        /// A set of tags (key-value pairs) associated with the adapter that has been retrieved.
        public let tags: [String: String]?

        @inlinable
        public init(adapterId: String? = nil, adapterName: String? = nil, autoUpdate: AutoUpdate? = nil, creationTime: Date? = nil, description: String? = nil, featureTypes: [FeatureType]? = nil, tags: [String: String]? = nil) {
            self.adapterId = adapterId
            self.adapterName = adapterName
            self.autoUpdate = autoUpdate
            self.creationTime = creationTime
            self.description = description
            self.featureTypes = featureTypes
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterName = "AdapterName"
            case autoUpdate = "AutoUpdate"
            case creationTime = "CreationTime"
            case description = "Description"
            case featureTypes = "FeatureTypes"
            case tags = "Tags"
        }
    }

    public struct GetAdapterVersionRequest: AWSEncodableShape {
        /// A string specifying a unique ID for the adapter version you want to retrieve information for.
        public let adapterId: String
        /// A string specifying the adapter version you want to retrieve information for.
        public let adapterVersion: String

        @inlinable
        public init(adapterId: String, adapterVersion: String) {
            self.adapterId = adapterId
            self.adapterVersion = adapterVersion
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.validate(self.adapterVersion, name: "adapterVersion", parent: name, max: 128)
            try self.validate(self.adapterVersion, name: "adapterVersion", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterVersion = "AdapterVersion"
        }
    }

    public struct GetAdapterVersionResponse: AWSDecodableShape {
        /// A string containing a unique ID for the adapter version being retrieved.
        public let adapterId: String?
        /// A string containing the adapter version that has been retrieved.
        public let adapterVersion: String?
        /// The time that the adapter version was created.
        public let creationTime: Date?
        /// Specifies a dataset used to train a new adapter version. Takes a ManifestS3Objec as the value.
        public let datasetConfig: AdapterVersionDatasetConfig?
        /// The evaluation metrics (F1 score, Precision, and Recall) for the requested version,  grouped by baseline metrics and adapter version.
        public let evaluationMetrics: [AdapterVersionEvaluationMetric]?
        /// List of the targeted feature types for the requested adapter version.
        public let featureTypes: [FeatureType]?
        /// The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.
        public let kmsKeyId: String?
        public let outputConfig: OutputConfig?
        /// The status of the adapter version that has been requested.
        public let status: AdapterVersionStatus?
        /// A message that describes the status of the requested adapter version.
        public let statusMessage: String?
        /// A set of tags (key-value pairs) that are associated with the adapter version.
        public let tags: [String: String]?

        @inlinable
        public init(adapterId: String? = nil, adapterVersion: String? = nil, creationTime: Date? = nil, datasetConfig: AdapterVersionDatasetConfig? = nil, evaluationMetrics: [AdapterVersionEvaluationMetric]? = nil, featureTypes: [FeatureType]? = nil, kmsKeyId: String? = nil, outputConfig: OutputConfig? = nil, status: AdapterVersionStatus? = nil, statusMessage: String? = nil, tags: [String: String]? = nil) {
            self.adapterId = adapterId
            self.adapterVersion = adapterVersion
            self.creationTime = creationTime
            self.datasetConfig = datasetConfig
            self.evaluationMetrics = evaluationMetrics
            self.featureTypes = featureTypes
            self.kmsKeyId = kmsKeyId
            self.outputConfig = outputConfig
            self.status = status
            self.statusMessage = statusMessage
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterVersion = "AdapterVersion"
            case creationTime = "CreationTime"
            case datasetConfig = "DatasetConfig"
            case evaluationMetrics = "EvaluationMetrics"
            case featureTypes = "FeatureTypes"
            case kmsKeyId = "KMSKeyId"
            case outputConfig = "OutputConfig"
            case status = "Status"
            case statusMessage = "StatusMessage"
            case tags = "Tags"
        }
    }

    public struct GetDocumentAnalysisRequest: AWSEncodableShape {
        /// A unique identifier for the text-detection job. The JobId is returned from StartDocumentAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String
        /// The maximum number of results to return per paginated call. The largest value that you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
        public let nextToken: String?

        @inlinable
        public init(jobId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.jobId = jobId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 64)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetDocumentAnalysisResponse: AWSDecodableShape {
        public let analyzeDocumentModelVersion: String?
        /// The results of the text-analysis operation.
        public let blocks: [Block]?
        /// Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.
        public let documentMetadata: DocumentMetadata?
        /// The current status of the text detection job.
        public let jobStatus: JobStatus?
        /// If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.
        public let nextToken: String?
        /// Returns if the detection job could not be completed. Contains explanation for what error occured.
        public let statusMessage: String?
        /// A list of warnings that occurred during the document-analysis operation.
        public let warnings: [Warning]?

        @inlinable
        public init(analyzeDocumentModelVersion: String? = nil, blocks: [Block]? = nil, documentMetadata: DocumentMetadata? = nil, jobStatus: JobStatus? = nil, nextToken: String? = nil, statusMessage: String? = nil, warnings: [Warning]? = nil) {
            self.analyzeDocumentModelVersion = analyzeDocumentModelVersion
            self.blocks = blocks
            self.documentMetadata = documentMetadata
            self.jobStatus = jobStatus
            self.nextToken = nextToken
            self.statusMessage = statusMessage
            self.warnings = warnings
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeDocumentModelVersion = "AnalyzeDocumentModelVersion"
            case blocks = "Blocks"
            case documentMetadata = "DocumentMetadata"
            case jobStatus = "JobStatus"
            case nextToken = "NextToken"
            case statusMessage = "StatusMessage"
            case warnings = "Warnings"
        }
    }

    public struct GetDocumentTextDetectionRequest: AWSEncodableShape {
        /// A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection. A JobId value is only valid for 7 days.
        public let jobId: String
        /// The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
        public let nextToken: String?

        @inlinable
        public init(jobId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.jobId = jobId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 64)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetDocumentTextDetectionResponse: AWSDecodableShape {
        /// The results of the text-detection operation.
        public let blocks: [Block]?
        public let detectDocumentTextModelVersion: String?
        /// Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.
        public let documentMetadata: DocumentMetadata?
        /// The current status of the text detection job.
        public let jobStatus: JobStatus?
        /// If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.
        public let nextToken: String?
        /// Returns if the detection job could not be completed. Contains explanation for what error occured.
        public let statusMessage: String?
        /// A list of warnings that occurred during the text-detection operation for the document.
        public let warnings: [Warning]?

        @inlinable
        public init(blocks: [Block]? = nil, detectDocumentTextModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil, jobStatus: JobStatus? = nil, nextToken: String? = nil, statusMessage: String? = nil, warnings: [Warning]? = nil) {
            self.blocks = blocks
            self.detectDocumentTextModelVersion = detectDocumentTextModelVersion
            self.documentMetadata = documentMetadata
            self.jobStatus = jobStatus
            self.nextToken = nextToken
            self.statusMessage = statusMessage
            self.warnings = warnings
        }

        private enum CodingKeys: String, CodingKey {
            case blocks = "Blocks"
            case detectDocumentTextModelVersion = "DetectDocumentTextModelVersion"
            case documentMetadata = "DocumentMetadata"
            case jobStatus = "JobStatus"
            case nextToken = "NextToken"
            case statusMessage = "StatusMessage"
            case warnings = "Warnings"
        }
    }

    public struct GetExpenseAnalysisRequest: AWSEncodableShape {
        /// A unique identifier for the text detection job. The JobId is returned from StartExpenseAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String
        /// The maximum number of results to return per paginated call. The largest value you can specify is 20. If you specify a value greater than 20, a maximum of 20 results is returned. The default value is 20.
        public let maxResults: Int?
        /// If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
        public let nextToken: String?

        @inlinable
        public init(jobId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.jobId = jobId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 64)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetExpenseAnalysisResponse: AWSDecodableShape {
        /// The current model version of AnalyzeExpense.
        public let analyzeExpenseModelVersion: String?
        /// Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract operation.
        public let documentMetadata: DocumentMetadata?
        /// The expenses detected by Amazon Textract.
        public let expenseDocuments: [ExpenseDocument]?
        /// The current status of the text detection job.
        public let jobStatus: JobStatus?
        /// If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.
        public let nextToken: String?
        /// Returns if the detection job could not be completed. Contains explanation for what error occured.
        public let statusMessage: String?
        /// A list of warnings that occurred during the text-detection operation for the document.
        public let warnings: [Warning]?

        @inlinable
        public init(analyzeExpenseModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil, expenseDocuments: [ExpenseDocument]? = nil, jobStatus: JobStatus? = nil, nextToken: String? = nil, statusMessage: String? = nil, warnings: [Warning]? = nil) {
            self.analyzeExpenseModelVersion = analyzeExpenseModelVersion
            self.documentMetadata = documentMetadata
            self.expenseDocuments = expenseDocuments
            self.jobStatus = jobStatus
            self.nextToken = nextToken
            self.statusMessage = statusMessage
            self.warnings = warnings
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeExpenseModelVersion = "AnalyzeExpenseModelVersion"
            case documentMetadata = "DocumentMetadata"
            case expenseDocuments = "ExpenseDocuments"
            case jobStatus = "JobStatus"
            case nextToken = "NextToken"
            case statusMessage = "StatusMessage"
            case warnings = "Warnings"
        }
    }

    public struct GetLendingAnalysisRequest: AWSEncodableShape {
        /// A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String
        /// The maximum number of results to return per paginated call. The largest value that you can specify is 30. If you specify a value greater than 30, a maximum of 30 results is returned. The default value is 30.
        public let maxResults: Int?
        /// If the previous response was incomplete, Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of lending results.
        public let nextToken: String?

        @inlinable
        public init(jobId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.jobId = jobId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 64)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetLendingAnalysisResponse: AWSDecodableShape {
        ///  The current model version of the Analyze Lending API.
        public let analyzeLendingModelVersion: String?
        public let documentMetadata: DocumentMetadata?
        ///  The current status of the lending analysis job.
        public let jobStatus: JobStatus?
        /// If the response is truncated, Amazon Textract returns this token.  You can use this token in the subsequent request to retrieve the next set of lending results.
        public let nextToken: String?
        ///  Holds the information returned by one of AmazonTextract's document analysis operations for the pinstripe.
        public let results: [LendingResult]?
        ///   Returns if the lending analysis job could not be completed. Contains explanation for what error occurred.
        public let statusMessage: String?
        ///  A list of warnings that occurred during the lending analysis operation.
        public let warnings: [Warning]?

        @inlinable
        public init(analyzeLendingModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil, jobStatus: JobStatus? = nil, nextToken: String? = nil, results: [LendingResult]? = nil, statusMessage: String? = nil, warnings: [Warning]? = nil) {
            self.analyzeLendingModelVersion = analyzeLendingModelVersion
            self.documentMetadata = documentMetadata
            self.jobStatus = jobStatus
            self.nextToken = nextToken
            self.results = results
            self.statusMessage = statusMessage
            self.warnings = warnings
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeLendingModelVersion = "AnalyzeLendingModelVersion"
            case documentMetadata = "DocumentMetadata"
            case jobStatus = "JobStatus"
            case nextToken = "NextToken"
            case results = "Results"
            case statusMessage = "StatusMessage"
            case warnings = "Warnings"
        }
    }

    public struct GetLendingAnalysisSummaryRequest: AWSEncodableShape {
        ///  A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String

        @inlinable
        public init(jobId: String) {
            self.jobId = jobId
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 64)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct GetLendingAnalysisSummaryResponse: AWSDecodableShape {
        /// The current model version of the Analyze Lending API.
        public let analyzeLendingModelVersion: String?
        public let documentMetadata: DocumentMetadata?
        ///  The current status of the lending analysis job.
        public let jobStatus: JobStatus?
        /// Returns if the lending analysis could not be completed. Contains explanation for what error occurred.
        public let statusMessage: String?
        ///  Contains summary information for documents grouped by type.
        public let summary: LendingSummary?
        /// A list of warnings that occurred during the lending analysis operation.
        public let warnings: [Warning]?

        @inlinable
        public init(analyzeLendingModelVersion: String? = nil, documentMetadata: DocumentMetadata? = nil, jobStatus: JobStatus? = nil, statusMessage: String? = nil, summary: LendingSummary? = nil, warnings: [Warning]? = nil) {
            self.analyzeLendingModelVersion = analyzeLendingModelVersion
            self.documentMetadata = documentMetadata
            self.jobStatus = jobStatus
            self.statusMessage = statusMessage
            self.summary = summary
            self.warnings = warnings
        }

        private enum CodingKeys: String, CodingKey {
            case analyzeLendingModelVersion = "AnalyzeLendingModelVersion"
            case documentMetadata = "DocumentMetadata"
            case jobStatus = "JobStatus"
            case statusMessage = "StatusMessage"
            case summary = "Summary"
            case warnings = "Warnings"
        }
    }

    public struct HumanLoopActivationOutput: AWSDecodableShape {
        /// Shows the result of condition evaluations, including those conditions which activated a human review.
        public let humanLoopActivationConditionsEvaluationResults: String?
        /// Shows if and why human review was needed.
        public let humanLoopActivationReasons: [String]?
        /// The Amazon Resource Name (ARN) of the HumanLoop created.
        public let humanLoopArn: String?

        @inlinable
        public init(humanLoopActivationConditionsEvaluationResults: String? = nil, humanLoopActivationReasons: [String]? = nil, humanLoopArn: String? = nil) {
            self.humanLoopActivationConditionsEvaluationResults = humanLoopActivationConditionsEvaluationResults
            self.humanLoopActivationReasons = humanLoopActivationReasons
            self.humanLoopArn = humanLoopArn
        }

        private enum CodingKeys: String, CodingKey {
            case humanLoopActivationConditionsEvaluationResults = "HumanLoopActivationConditionsEvaluationResults"
            case humanLoopActivationReasons = "HumanLoopActivationReasons"
            case humanLoopArn = "HumanLoopArn"
        }
    }

    public struct HumanLoopConfig: AWSEncodableShape {
        /// Sets attributes of the input data.
        public let dataAttributes: HumanLoopDataAttributes?
        /// The Amazon Resource Name (ARN) of the flow definition.
        public let flowDefinitionArn: String
        /// The name of the human workflow used for this image. This should be kept unique within a region.
        public let humanLoopName: String

        @inlinable
        public init(dataAttributes: HumanLoopDataAttributes? = nil, flowDefinitionArn: String, humanLoopName: String) {
            self.dataAttributes = dataAttributes
            self.flowDefinitionArn = flowDefinitionArn
            self.humanLoopName = humanLoopName
        }

        public func validate(name: String) throws {
            try self.dataAttributes?.validate(name: "\(name).dataAttributes")
            try self.validate(self.flowDefinitionArn, name: "flowDefinitionArn", parent: name, max: 256)
            try self.validate(self.humanLoopName, name: "humanLoopName", parent: name, max: 63)
            try self.validate(self.humanLoopName, name: "humanLoopName", parent: name, min: 1)
            try self.validate(self.humanLoopName, name: "humanLoopName", parent: name, pattern: "^[a-z0-9](-*[a-z0-9])*$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataAttributes = "DataAttributes"
            case flowDefinitionArn = "FlowDefinitionArn"
            case humanLoopName = "HumanLoopName"
        }
    }

    public struct HumanLoopDataAttributes: AWSEncodableShape {
        /// Sets whether the input image is free of personally identifiable information or adult content.
        public let contentClassifiers: [ContentClassifier]?

        @inlinable
        public init(contentClassifiers: [ContentClassifier]? = nil) {
            self.contentClassifiers = contentClassifiers
        }

        public func validate(name: String) throws {
            try self.validate(self.contentClassifiers, name: "contentClassifiers", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case contentClassifiers = "ContentClassifiers"
        }
    }

    public struct HumanLoopQuotaExceededException: AWSErrorShape {
        public let code: String?
        public let message: String?
        /// The quota code.
        public let quotaCode: String?
        /// The resource type.
        public let resourceType: String?
        /// The service code.
        public let serviceCode: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil, quotaCode: String? = nil, resourceType: String? = nil, serviceCode: String? = nil) {
            self.code = code
            self.message = message
            self.quotaCode = quotaCode
            self.resourceType = resourceType
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
            case quotaCode = "QuotaCode"
            case resourceType = "ResourceType"
            case serviceCode = "ServiceCode"
        }
    }

    public struct IdempotentParameterMismatchException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct IdentityDocument: AWSDecodableShape {
        /// Individual word recognition, as returned by document detection.
        public let blocks: [Block]?
        /// Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.
        public let documentIndex: Int?
        /// The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.
        public let identityDocumentFields: [IdentityDocumentField]?

        @inlinable
        public init(blocks: [Block]? = nil, documentIndex: Int? = nil, identityDocumentFields: [IdentityDocumentField]? = nil) {
            self.blocks = blocks
            self.documentIndex = documentIndex
            self.identityDocumentFields = identityDocumentFields
        }

        private enum CodingKeys: String, CodingKey {
            case blocks = "Blocks"
            case documentIndex = "DocumentIndex"
            case identityDocumentFields = "IdentityDocumentFields"
        }
    }

    public struct IdentityDocumentField: AWSDecodableShape {
        public let type: AnalyzeIDDetections?
        public let valueDetection: AnalyzeIDDetections?

        @inlinable
        public init(type: AnalyzeIDDetections? = nil, valueDetection: AnalyzeIDDetections? = nil) {
            self.type = type
            self.valueDetection = valueDetection
        }

        private enum CodingKeys: String, CodingKey {
            case type = "Type"
            case valueDetection = "ValueDetection"
        }
    }

    public struct InternalServerError: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct InvalidJobIdException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct InvalidKMSKeyException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct InvalidParameterException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct InvalidS3ObjectException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct LendingDetection: AWSDecodableShape {
        /// The confidence level for the text of a detected value in a lending document.
        public let confidence: Float?
        public let geometry: Geometry?
        /// The selection status of a selection element, such as an option button or check box.
        public let selectionStatus: SelectionStatus?
        /// The text extracted for a detected value in a lending document.
        public let text: String?

        @inlinable
        public init(confidence: Float? = nil, geometry: Geometry? = nil, selectionStatus: SelectionStatus? = nil, text: String? = nil) {
            self.confidence = confidence
            self.geometry = geometry
            self.selectionStatus = selectionStatus
            self.text = text
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case geometry = "Geometry"
            case selectionStatus = "SelectionStatus"
            case text = "Text"
        }
    }

    public struct LendingDocument: AWSDecodableShape {
        /// An array of LendingField objects.
        public let lendingFields: [LendingField]?
        /// A list of signatures detected in a lending document.
        public let signatureDetections: [SignatureDetection]?

        @inlinable
        public init(lendingFields: [LendingField]? = nil, signatureDetections: [SignatureDetection]? = nil) {
            self.lendingFields = lendingFields
            self.signatureDetections = signatureDetections
        }

        private enum CodingKeys: String, CodingKey {
            case lendingFields = "LendingFields"
            case signatureDetections = "SignatureDetections"
        }
    }

    public struct LendingField: AWSDecodableShape {
        public let keyDetection: LendingDetection?
        /// The type of the lending document.
        public let type: String?
        /// An array of LendingDetection objects.
        public let valueDetections: [LendingDetection]?

        @inlinable
        public init(keyDetection: LendingDetection? = nil, type: String? = nil, valueDetections: [LendingDetection]? = nil) {
            self.keyDetection = keyDetection
            self.type = type
            self.valueDetections = valueDetections
        }

        private enum CodingKeys: String, CodingKey {
            case keyDetection = "KeyDetection"
            case type = "Type"
            case valueDetections = "ValueDetections"
        }
    }

    public struct LendingResult: AWSDecodableShape {
        /// An array of Extraction to hold structured data. e.g. normalized key value pairs instead of raw OCR detections .
        public let extractions: [Extraction]?
        /// The page number for a page, with regard to whole submission.
        public let page: Int?
        /// The classifier result for a given page.
        public let pageClassification: PageClassification?

        @inlinable
        public init(extractions: [Extraction]? = nil, page: Int? = nil, pageClassification: PageClassification? = nil) {
            self.extractions = extractions
            self.page = page
            self.pageClassification = pageClassification
        }

        private enum CodingKeys: String, CodingKey {
            case extractions = "Extractions"
            case page = "Page"
            case pageClassification = "PageClassification"
        }
    }

    public struct LendingSummary: AWSDecodableShape {
        /// Contains an array of all DocumentGroup objects.
        public let documentGroups: [DocumentGroup]?
        /// UndetectedDocumentTypes.
        public let undetectedDocumentTypes: [String]?

        @inlinable
        public init(documentGroups: [DocumentGroup]? = nil, undetectedDocumentTypes: [String]? = nil) {
            self.documentGroups = documentGroups
            self.undetectedDocumentTypes = undetectedDocumentTypes
        }

        private enum CodingKeys: String, CodingKey {
            case documentGroups = "DocumentGroups"
            case undetectedDocumentTypes = "UndetectedDocumentTypes"
        }
    }

    public struct LimitExceededException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct LineItemFields: AWSDecodableShape {
        /// ExpenseFields used to show information from detected lines on a table.
        public let lineItemExpenseFields: [ExpenseField]?

        @inlinable
        public init(lineItemExpenseFields: [ExpenseField]? = nil) {
            self.lineItemExpenseFields = lineItemExpenseFields
        }

        private enum CodingKeys: String, CodingKey {
            case lineItemExpenseFields = "LineItemExpenseFields"
        }
    }

    public struct LineItemGroup: AWSDecodableShape {
        /// The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.
        public let lineItemGroupIndex: Int?
        /// The breakdown of information on a particular line of a table.
        public let lineItems: [LineItemFields]?

        @inlinable
        public init(lineItemGroupIndex: Int? = nil, lineItems: [LineItemFields]? = nil) {
            self.lineItemGroupIndex = lineItemGroupIndex
            self.lineItems = lineItems
        }

        private enum CodingKeys: String, CodingKey {
            case lineItemGroupIndex = "LineItemGroupIndex"
            case lineItems = "LineItems"
        }
    }

    public struct ListAdapterVersionsRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter to match for when listing adapter versions.
        public let adapterId: String?
        /// Specifies the lower bound for the ListAdapterVersions operation.  Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.
        public let afterCreationTime: Date?
        /// Specifies the upper bound for the ListAdapterVersions operation.  Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.
        public let beforeCreationTime: Date?
        /// The maximum number of results to return when listing adapter versions.
        public let maxResults: Int?
        /// Identifies the next page of results to return when listing adapter versions.
        public let nextToken: String?

        @inlinable
        public init(adapterId: String? = nil, afterCreationTime: Date? = nil, beforeCreationTime: Date? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.adapterId = adapterId
            self.afterCreationTime = afterCreationTime
            self.beforeCreationTime = beforeCreationTime
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case afterCreationTime = "AfterCreationTime"
            case beforeCreationTime = "BeforeCreationTime"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListAdapterVersionsResponse: AWSDecodableShape {
        /// Adapter versions that match the filtering criteria specified when calling ListAdapters.
        public let adapterVersions: [AdapterVersionOverview]?
        /// Identifies the next page of results to return when listing adapter versions.
        public let nextToken: String?

        @inlinable
        public init(adapterVersions: [AdapterVersionOverview]? = nil, nextToken: String? = nil) {
            self.adapterVersions = adapterVersions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case adapterVersions = "AdapterVersions"
            case nextToken = "NextToken"
        }
    }

    public struct ListAdaptersRequest: AWSEncodableShape {
        /// Specifies the lower bound for the ListAdapters operation.  Ensures ListAdapters returns only adapters created after the specified creation time.
        public let afterCreationTime: Date?
        /// Specifies the upper bound for the ListAdapters operation.  Ensures ListAdapters returns only adapters created before the specified creation time.
        public let beforeCreationTime: Date?
        /// The maximum number of results to return when listing adapters.
        public let maxResults: Int?
        /// Identifies the next page of results to return when listing adapters.
        public let nextToken: String?

        @inlinable
        public init(afterCreationTime: Date? = nil, beforeCreationTime: Date? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.afterCreationTime = afterCreationTime
            self.beforeCreationTime = beforeCreationTime
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case afterCreationTime = "AfterCreationTime"
            case beforeCreationTime = "BeforeCreationTime"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListAdaptersResponse: AWSDecodableShape {
        /// A list of adapters that matches the filtering criteria specified when calling ListAdapters.
        public let adapters: [AdapterOverview]?
        /// Identifies the next page of results to return when listing adapters.
        public let nextToken: String?

        @inlinable
        public init(adapters: [AdapterOverview]? = nil, nextToken: String? = nil) {
            self.adapters = adapters
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case adapters = "Adapters"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that specifies the resource to list tags for.
        public let resourceARN: String

        @inlinable
        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A set of tags (key-value pairs) that are part of the requested resource.
        public let tags: [String: String]?

        @inlinable
        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct NormalizedValue: AWSDecodableShape {
        /// The value of the date, written as Year-Month-DayTHour:Minute:Second.
        public let value: String?
        /// The normalized type of the value detected. In this case, DATE.
        public let valueType: ValueType?

        @inlinable
        public init(value: String? = nil, valueType: ValueType? = nil) {
            self.value = value
            self.valueType = valueType
        }

        private enum CodingKeys: String, CodingKey {
            case value = "Value"
            case valueType = "ValueType"
        }
    }

    public struct NotificationChannel: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic.
        public let roleArn: String
        /// The Amazon SNS topic that Amazon Textract posts the completion status to.
        public let snsTopicArn: String

        @inlinable
        public init(roleArn: String, snsTopicArn: String) {
            self.roleArn = roleArn
            self.snsTopicArn = snsTopicArn
        }

        public func validate(name: String) throws {
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "^arn:([a-z\\d-]+):iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.snsTopicArn, name: "snsTopicArn", parent: name, max: 1024)
            try self.validate(self.snsTopicArn, name: "snsTopicArn", parent: name, min: 20)
            try self.validate(self.snsTopicArn, name: "snsTopicArn", parent: name, pattern: "^(^arn:([a-z\\d-]+):sns:[a-zA-Z\\d-]{1,20}:\\w{12}:.+$)$")
        }

        private enum CodingKeys: String, CodingKey {
            case roleArn = "RoleArn"
            case snsTopicArn = "SNSTopicArn"
        }
    }

    public struct OutputConfig: AWSEncodableShape & AWSDecodableShape {
        /// The name of the bucket your output will go to.
        public let s3Bucket: String
        /// The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".
        public let s3Prefix: String?

        @inlinable
        public init(s3Bucket: String, s3Prefix: String? = nil) {
            self.s3Bucket = s3Bucket
            self.s3Prefix = s3Prefix
        }

        public func validate(name: String) throws {
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, max: 255)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, min: 3)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, pattern: "^[0-9A-Za-z\\.\\-_]*$")
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, max: 1024)
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, min: 1)
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Bucket = "S3Bucket"
            case s3Prefix = "S3Prefix"
        }
    }

    public struct PageClassification: AWSDecodableShape {
        ///  The page number the value was detected on, relative to Amazon Textract's starting position.
        public let pageNumber: [Prediction]
        /// The class, or document type, assigned to a detected Page object. The class, or document type,  assigned to a detected Page object.
        public let pageType: [Prediction]

        @inlinable
        public init(pageNumber: [Prediction], pageType: [Prediction]) {
            self.pageNumber = pageNumber
            self.pageType = pageType
        }

        private enum CodingKeys: String, CodingKey {
            case pageNumber = "PageNumber"
            case pageType = "PageType"
        }
    }

    public struct Point: AWSDecodableShape {
        /// The value of the X coordinate for a point on a Polygon.
        public let x: Float?
        /// The value of the Y coordinate for a point on a Polygon.
        public let y: Float?

        @inlinable
        public init(x: Float? = nil, y: Float? = nil) {
            self.x = x
            self.y = y
        }

        private enum CodingKeys: String, CodingKey {
            case x = "X"
            case y = "Y"
        }
    }

    public struct Prediction: AWSDecodableShape {
        /// Amazon Textract's confidence in its predicted value.
        public let confidence: Float?
        /// The predicted value of a detected object.
        public let value: String?

        @inlinable
        public init(confidence: Float? = nil, value: String? = nil) {
            self.confidence = confidence
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case value = "Value"
        }
    }

    public struct ProvisionedThroughputExceededException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct QueriesConfig: AWSEncodableShape {
        public let queries: [Query]

        @inlinable
        public init(queries: [Query]) {
            self.queries = queries
        }

        public func validate(name: String) throws {
            try self.queries.forEach {
                try $0.validate(name: "\(name).queries[]")
            }
            try self.validate(self.queries, name: "queries", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case queries = "Queries"
        }
    }

    public struct Query: AWSEncodableShape & AWSDecodableShape {
        /// Alias attached to the query, for ease of location.
        public let alias: String?
        /// Pages is a parameter that the user inputs to specify which pages to apply a query to. The following is a  list of rules for using this parameter.   If a page is not specified, it is set to ["1"] by default.   The following characters are allowed in the parameter's string:  0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed.   When using * to indicate all pages, it must be the only element in the list.   You can use page intervals, such as [“1-3”, “1-1”, “4-*”]. Where * indicates last page of  document.   Specified pages must be greater than 0 and less than or equal to the number of pages in the document.
        public let pages: [String]?
        /// Question that Amazon Textract will apply to the document. An example would be "What is the customer's SSN?"
        public let text: String

        @inlinable
        public init(alias: String? = nil, pages: [String]? = nil, text: String) {
            self.alias = alias
            self.pages = pages
            self.text = text
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 200)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "^[a-zA-Z0-9\\s!\"\\#\\$%'&\\(\\)\\*\\+\\,\\-\\./:;=\\?@\\[\\\\\\]\\^_`\\{\\|\\}~><]+$")
            try self.pages?.forEach {
                try validate($0, name: "pages[]", parent: name, max: 9)
                try validate($0, name: "pages[]", parent: name, min: 1)
                try validate($0, name: "pages[]", parent: name, pattern: "^[0-9\\*\\-]+$")
            }
            try self.validate(self.pages, name: "pages", parent: name, min: 1)
            try self.validate(self.text, name: "text", parent: name, max: 200)
            try self.validate(self.text, name: "text", parent: name, min: 1)
            try self.validate(self.text, name: "text", parent: name, pattern: "^[a-zA-Z0-9\\s!\"\\#\\$%'&\\(\\)\\*\\+\\,\\-\\./:;=\\?@\\[\\\\\\]\\^_`\\{\\|\\}~><]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case pages = "Pages"
            case text = "Text"
        }
    }

    public struct Relationship: AWSDecodableShape {
        /// An array of IDs for related blocks. You can get the type of the relationship from the Type element.
        public let ids: [String]?
        /// The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.     VALUE - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.    CHILD - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.    MERGED_CELL - A list of IDs that identify each of the MERGED_CELL block types in a table.    ANSWER - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.     TABLE - A list of IDs that identify associated TABLE block types.     TABLE_TITLE - A list that contains the ID for the TABLE_TITLE block type in a table.     TABLE_FOOTER - A list of IDs that identify the TABLE_FOOTER block types in a table.
        public let type: RelationshipType?

        @inlinable
        public init(ids: [String]? = nil, type: RelationshipType? = nil) {
            self.ids = ids
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case ids = "Ids"
            case type = "Type"
        }
    }

    public struct ResourceNotFoundException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct S3Object: AWSEncodableShape & AWSDecodableShape {
        /// The name of the S3 bucket. Note that the # character is not valid in the file name.
        public let bucket: String?
        /// The file name of the input document. Image files may be in PDF, TIFF, JPEG, or PNG format.
        public let name: String?
        /// If the bucket has versioning enabled, you can specify the object version.
        public let version: String?

        @inlinable
        public init(bucket: String? = nil, name: String? = nil, version: String? = nil) {
            self.bucket = bucket
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.bucket, name: "bucket", parent: name, max: 255)
            try self.validate(self.bucket, name: "bucket", parent: name, min: 3)
            try self.validate(self.bucket, name: "bucket", parent: name, pattern: "^[0-9A-Za-z\\.\\-_]*$")
            try self.validate(self.name, name: "name", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "\\S")
            try self.validate(self.version, name: "version", parent: name, max: 1024)
            try self.validate(self.version, name: "version", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case bucket = "Bucket"
            case name = "Name"
            case version = "Version"
        }
    }

    public struct ServiceQuotaExceededException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct SignatureDetection: AWSDecodableShape {
        /// The confidence, from 0 to 100, in the predicted values for a detected signature.
        public let confidence: Float?
        public let geometry: Geometry?

        @inlinable
        public init(confidence: Float? = nil, geometry: Geometry? = nil) {
            self.confidence = confidence
            self.geometry = geometry
        }

        private enum CodingKeys: String, CodingKey {
            case confidence = "Confidence"
            case geometry = "Geometry"
        }
    }

    public struct SplitDocument: AWSDecodableShape {
        /// The index for a given document in a DocumentGroup of a specific Type.
        public let index: Int?
        /// An array of page numbers for a for a given document, ordered by logical boundary.
        public let pages: [Int]?

        @inlinable
        public init(index: Int? = nil, pages: [Int]? = nil) {
            self.index = index
            self.pages = pages
        }

        private enum CodingKeys: String, CodingKey {
            case index = "Index"
            case pages = "Pages"
        }
    }

    public struct StartDocumentAnalysisRequest: AWSEncodableShape {
        /// Specifies the adapter to be used when analyzing a document.
        public let adaptersConfig: AdaptersConfig?
        /// The idempotent token that you use to identify the start request. If you use the same token with multiple StartDocumentAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.
        public let clientRequestToken: String?
        /// The location of the document to be processed.
        public let documentLocation: DocumentLocation
        /// A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. To perform both types of analysis, add TABLES and FORMS to FeatureTypes. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).
        public let featureTypes: [FeatureType]
        /// An identifier that you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).
        public let jobTag: String?
        /// The KMS key used to encrypt the inference results. This can be  in either Key ID or Key Alias format. When a KMS key is provided, the  KMS key will be used for server-side encryption of the objects in the  customer bucket. When this parameter is not enabled, the result will  be encrypted server side,using SSE-S3.
        public let kmsKeyId: String?
        /// The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
        public let notificationChannel: NotificationChannel?
        /// Sets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the GetDocumentAnalysis operation.
        public let outputConfig: OutputConfig?
        public let queriesConfig: QueriesConfig?

        @inlinable
        public init(adaptersConfig: AdaptersConfig? = nil, clientRequestToken: String? = nil, documentLocation: DocumentLocation, featureTypes: [FeatureType], jobTag: String? = nil, kmsKeyId: String? = nil, notificationChannel: NotificationChannel? = nil, outputConfig: OutputConfig? = nil, queriesConfig: QueriesConfig? = nil) {
            self.adaptersConfig = adaptersConfig
            self.clientRequestToken = clientRequestToken
            self.documentLocation = documentLocation
            self.featureTypes = featureTypes
            self.jobTag = jobTag
            self.kmsKeyId = kmsKeyId
            self.notificationChannel = notificationChannel
            self.outputConfig = outputConfig
            self.queriesConfig = queriesConfig
        }

        public func validate(name: String) throws {
            try self.adaptersConfig?.validate(name: "\(name).adaptersConfig")
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.documentLocation.validate(name: "\(name).documentLocation")
            try self.validate(self.jobTag, name: "jobTag", parent: name, max: 64)
            try self.validate(self.jobTag, name: "jobTag", parent: name, min: 1)
            try self.validate(self.jobTag, name: "jobTag", parent: name, pattern: "^[a-zA-Z0-9_.\\-:]+$")
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, max: 2048)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, min: 1)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, pattern: "^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$")
            try self.notificationChannel?.validate(name: "\(name).notificationChannel")
            try self.outputConfig?.validate(name: "\(name).outputConfig")
            try self.queriesConfig?.validate(name: "\(name).queriesConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case adaptersConfig = "AdaptersConfig"
            case clientRequestToken = "ClientRequestToken"
            case documentLocation = "DocumentLocation"
            case featureTypes = "FeatureTypes"
            case jobTag = "JobTag"
            case kmsKeyId = "KMSKeyId"
            case notificationChannel = "NotificationChannel"
            case outputConfig = "OutputConfig"
            case queriesConfig = "QueriesConfig"
        }
    }

    public struct StartDocumentAnalysisResponse: AWSDecodableShape {
        /// The identifier for the document text detection job. Use JobId to identify the job in a subsequent call to GetDocumentAnalysis. A JobId value  is only valid for 7 days.
        public let jobId: String?

        @inlinable
        public init(jobId: String? = nil) {
            self.jobId = jobId
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StartDocumentTextDetectionRequest: AWSEncodableShape {
        /// The idempotent token that's used to identify the start request. If you use the same token with multiple StartDocumentTextDetection requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.
        public let clientRequestToken: String?
        /// The location of the document to be processed.
        public let documentLocation: DocumentLocation
        /// An identifier that you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).
        public let jobTag: String?
        /// The KMS key used to encrypt the inference results. This can be  in either Key ID or Key Alias format. When a KMS key is provided, the  KMS key will be used for server-side encryption of the objects in the  customer bucket. When this parameter is not enabled, the result will  be encrypted server side,using SSE-S3.
        public let kmsKeyId: String?
        /// The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
        public let notificationChannel: NotificationChannel?
        /// Sets if the output will go to a customer defined bucket. By default Amazon Textract will save the results internally to be accessed with the GetDocumentTextDetection operation.
        public let outputConfig: OutputConfig?

        @inlinable
        public init(clientRequestToken: String? = nil, documentLocation: DocumentLocation, jobTag: String? = nil, kmsKeyId: String? = nil, notificationChannel: NotificationChannel? = nil, outputConfig: OutputConfig? = nil) {
            self.clientRequestToken = clientRequestToken
            self.documentLocation = documentLocation
            self.jobTag = jobTag
            self.kmsKeyId = kmsKeyId
            self.notificationChannel = notificationChannel
            self.outputConfig = outputConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.documentLocation.validate(name: "\(name).documentLocation")
            try self.validate(self.jobTag, name: "jobTag", parent: name, max: 64)
            try self.validate(self.jobTag, name: "jobTag", parent: name, min: 1)
            try self.validate(self.jobTag, name: "jobTag", parent: name, pattern: "^[a-zA-Z0-9_.\\-:]+$")
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, max: 2048)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, min: 1)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, pattern: "^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$")
            try self.notificationChannel?.validate(name: "\(name).notificationChannel")
            try self.outputConfig?.validate(name: "\(name).outputConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case documentLocation = "DocumentLocation"
            case jobTag = "JobTag"
            case kmsKeyId = "KMSKeyId"
            case notificationChannel = "NotificationChannel"
            case outputConfig = "OutputConfig"
        }
    }

    public struct StartDocumentTextDetectionResponse: AWSDecodableShape {
        /// The identifier of the text detection job for the document. Use JobId to identify the job in a subsequent call to GetDocumentTextDetection. A JobId value is only valid for 7 days.
        public let jobId: String?

        @inlinable
        public init(jobId: String? = nil) {
            self.jobId = jobId
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StartExpenseAnalysisRequest: AWSEncodableShape {
        /// The idempotent token that's used to identify the start request. If you use the same token with multiple StartDocumentTextDetection requests, the same JobId is returned.  Use ClientRequestToken to prevent the same job from being accidentally started more than once.  For more information, see Calling Amazon Textract Asynchronous Operations
        public let clientRequestToken: String?
        /// The location of the document to be processed.
        public let documentLocation: DocumentLocation
        /// An identifier you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).
        public let jobTag: String?
        /// The KMS key used to encrypt the inference results. This can be  in either Key ID or Key Alias format. When a KMS key is provided, the  KMS key will be used for server-side encryption of the objects in the  customer bucket. When this parameter is not enabled, the result will  be encrypted server side,using SSE-S3.
        public let kmsKeyId: String?
        /// The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
        public let notificationChannel: NotificationChannel?
        /// Sets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the GetExpenseAnalysis operation.
        public let outputConfig: OutputConfig?

        @inlinable
        public init(clientRequestToken: String? = nil, documentLocation: DocumentLocation, jobTag: String? = nil, kmsKeyId: String? = nil, notificationChannel: NotificationChannel? = nil, outputConfig: OutputConfig? = nil) {
            self.clientRequestToken = clientRequestToken
            self.documentLocation = documentLocation
            self.jobTag = jobTag
            self.kmsKeyId = kmsKeyId
            self.notificationChannel = notificationChannel
            self.outputConfig = outputConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.documentLocation.validate(name: "\(name).documentLocation")
            try self.validate(self.jobTag, name: "jobTag", parent: name, max: 64)
            try self.validate(self.jobTag, name: "jobTag", parent: name, min: 1)
            try self.validate(self.jobTag, name: "jobTag", parent: name, pattern: "^[a-zA-Z0-9_.\\-:]+$")
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, max: 2048)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, min: 1)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, pattern: "^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$")
            try self.notificationChannel?.validate(name: "\(name).notificationChannel")
            try self.outputConfig?.validate(name: "\(name).outputConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case documentLocation = "DocumentLocation"
            case jobTag = "JobTag"
            case kmsKeyId = "KMSKeyId"
            case notificationChannel = "NotificationChannel"
            case outputConfig = "OutputConfig"
        }
    }

    public struct StartExpenseAnalysisResponse: AWSDecodableShape {
        /// A unique identifier for the text detection job. The JobId is returned from StartExpenseAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String?

        @inlinable
        public init(jobId: String? = nil) {
            self.jobId = jobId
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct StartLendingAnalysisRequest: AWSEncodableShape {
        /// The idempotent token that you use to identify the start request. If you use the same token with multiple StartLendingAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.
        public let clientRequestToken: String?
        public let documentLocation: DocumentLocation
        /// An identifier that you specify to be included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).
        public let jobTag: String?
        /// The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side, using SSE-S3.
        public let kmsKeyId: String?
        public let notificationChannel: NotificationChannel?
        public let outputConfig: OutputConfig?

        @inlinable
        public init(clientRequestToken: String? = nil, documentLocation: DocumentLocation, jobTag: String? = nil, kmsKeyId: String? = nil, notificationChannel: NotificationChannel? = nil, outputConfig: OutputConfig? = nil) {
            self.clientRequestToken = clientRequestToken
            self.documentLocation = documentLocation
            self.jobTag = jobTag
            self.kmsKeyId = kmsKeyId
            self.notificationChannel = notificationChannel
            self.outputConfig = outputConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.documentLocation.validate(name: "\(name).documentLocation")
            try self.validate(self.jobTag, name: "jobTag", parent: name, max: 64)
            try self.validate(self.jobTag, name: "jobTag", parent: name, min: 1)
            try self.validate(self.jobTag, name: "jobTag", parent: name, pattern: "^[a-zA-Z0-9_.\\-:]+$")
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, max: 2048)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, min: 1)
            try self.validate(self.kmsKeyId, name: "kmsKeyId", parent: name, pattern: "^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$")
            try self.notificationChannel?.validate(name: "\(name).notificationChannel")
            try self.outputConfig?.validate(name: "\(name).outputConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case documentLocation = "DocumentLocation"
            case jobTag = "JobTag"
            case kmsKeyId = "KMSKeyId"
            case notificationChannel = "NotificationChannel"
            case outputConfig = "OutputConfig"
        }
    }

    public struct StartLendingAnalysisResponse: AWSDecodableShape {
        /// A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.
        public let jobId: String?

        @inlinable
        public init(jobId: String? = nil) {
            self.jobId = jobId
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that specifies the resource to be tagged.
        public let resourceARN: String
        /// A set of tags (key-value pairs) that you want to assign to the resource.
        public let tags: [String: String]

        @inlinable
        public init(resourceARN: String, tags: [String: String]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ThrottlingException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct UndetectedSignature: AWSDecodableShape {
        /// The page where a signature was expected but not found.
        public let page: Int?

        @inlinable
        public init(page: Int? = nil) {
            self.page = page
        }

        private enum CodingKeys: String, CodingKey {
            case page = "Page"
        }
    }

    public struct UnsupportedDocumentException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that specifies the resource to be untagged.
        public let resourceARN: String
        /// Specifies the tags to be removed from the resource specified by the ResourceARN.
        public let tagKeys: [String]

        @inlinable
        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateAdapterRequest: AWSEncodableShape {
        /// A string containing a unique ID for the adapter that will be updated.
        public let adapterId: String
        /// The new name to be applied to the adapter.
        public let adapterName: String?
        /// The new auto-update status to be applied to the adapter.
        public let autoUpdate: AutoUpdate?
        /// The new description to be applied to the adapter.
        public let description: String?

        @inlinable
        public init(adapterId: String, adapterName: String? = nil, autoUpdate: AutoUpdate? = nil, description: String? = nil) {
            self.adapterId = adapterId
            self.adapterName = adapterName
            self.autoUpdate = autoUpdate
            self.description = description
        }

        public func validate(name: String) throws {
            try self.validate(self.adapterId, name: "adapterId", parent: name, max: 1011)
            try self.validate(self.adapterId, name: "adapterId", parent: name, min: 12)
            try self.validate(self.adapterName, name: "adapterName", parent: name, max: 128)
            try self.validate(self.adapterName, name: "adapterName", parent: name, min: 1)
            try self.validate(self.adapterName, name: "adapterName", parent: name, pattern: "^[a-zA-Z0-9-_]+$")
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, pattern: "^[a-zA-Z0-9\\s!\"\\#\\$%'&\\(\\)\\*\\+\\,\\-\\./:;=\\?@\\[\\\\\\]\\^_`\\{\\|\\}~><]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterName = "AdapterName"
            case autoUpdate = "AutoUpdate"
            case description = "Description"
        }
    }

    public struct UpdateAdapterResponse: AWSDecodableShape {
        /// A string containing a unique ID for the adapter that has been updated.
        public let adapterId: String?
        /// A string containing the name of the adapter that has been updated.
        public let adapterName: String?
        /// The auto-update status of the adapter that has been updated.
        public let autoUpdate: AutoUpdate?
        /// An object specifying the creation time of the the adapter that has been updated.
        public let creationTime: Date?
        /// A string containing the description of the adapter that has been updated.
        public let description: String?
        /// List of the targeted feature types for the updated adapter.
        public let featureTypes: [FeatureType]?

        @inlinable
        public init(adapterId: String? = nil, adapterName: String? = nil, autoUpdate: AutoUpdate? = nil, creationTime: Date? = nil, description: String? = nil, featureTypes: [FeatureType]? = nil) {
            self.adapterId = adapterId
            self.adapterName = adapterName
            self.autoUpdate = autoUpdate
            self.creationTime = creationTime
            self.description = description
            self.featureTypes = featureTypes
        }

        private enum CodingKeys: String, CodingKey {
            case adapterId = "AdapterId"
            case adapterName = "AdapterName"
            case autoUpdate = "AutoUpdate"
            case creationTime = "CreationTime"
            case description = "Description"
            case featureTypes = "FeatureTypes"
        }
    }

    public struct ValidationException: AWSErrorShape {
        public let code: String?
        public let message: String?

        @inlinable
        public init(code: String? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct Warning: AWSDecodableShape {
        /// The error code for the warning.
        public let errorCode: String?
        /// A list of the pages that the warning applies to.
        public let pages: [Int]?

        @inlinable
        public init(errorCode: String? = nil, pages: [Int]? = nil) {
            self.errorCode = errorCode
            self.pages = pages
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case pages = "Pages"
        }
    }
}

// MARK: - Errors

/// Error enum for Textract
public struct TextractErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case badDocumentException = "BadDocumentException"
        case conflictException = "ConflictException"
        case documentTooLargeException = "DocumentTooLargeException"
        case humanLoopQuotaExceededException = "HumanLoopQuotaExceededException"
        case idempotentParameterMismatchException = "IdempotentParameterMismatchException"
        case internalServerError = "InternalServerError"
        case invalidJobIdException = "InvalidJobIdException"
        case invalidKMSKeyException = "InvalidKMSKeyException"
        case invalidParameterException = "InvalidParameterException"
        case invalidS3ObjectException = "InvalidS3ObjectException"
        case limitExceededException = "LimitExceededException"
        case provisionedThroughputExceededException = "ProvisionedThroughputExceededException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case unsupportedDocumentException = "UnsupportedDocumentException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Textract
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You aren't authorized to perform the action. Use the Amazon Resource Name (ARN)  of an authorized user or IAM role to perform the operation.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// Amazon Textract isn't able to read the document. For more information on the document limits in Amazon Textract, see limits.
    public static var badDocumentException: Self { .init(.badDocumentException) }
    /// Updating or deleting a resource can cause an inconsistent state.
    public static var conflictException: Self { .init(.conflictException) }
    /// The document can't be processed because it's too large. The maximum document size for synchronous operations 10 MB. The maximum document size for asynchronous operations is 500 MB for PDF files.
    public static var documentTooLargeException: Self { .init(.documentTooLargeException) }
    /// Indicates you have exceeded the maximum number of active human in the loop workflows available
    public static var humanLoopQuotaExceededException: Self { .init(.humanLoopQuotaExceededException) }
    /// A ClientRequestToken input parameter was reused with an operation, but at least one of the other input parameters is different from the previous call to the operation.
    public static var idempotentParameterMismatchException: Self { .init(.idempotentParameterMismatchException) }
    /// Amazon Textract experienced a service issue. Try your call again.
    public static var internalServerError: Self { .init(.internalServerError) }
    /// An invalid job identifier was passed to an asynchronous analysis operation.
    public static var invalidJobIdException: Self { .init(.invalidJobIdException) }
    ///  Indicates you do not have decrypt permissions with the KMS key entered, or the KMS key was entered incorrectly.
    public static var invalidKMSKeyException: Self { .init(.invalidKMSKeyException) }
    /// An input parameter violated a constraint. For example, in synchronous operations,  an InvalidParameterException exception occurs when neither of the S3Object or Bytes values are supplied in the Document request parameter. Validate your parameter before calling the API operation again.
    public static var invalidParameterException: Self { .init(.invalidParameterException) }
    /// Amazon Textract is unable to access the S3 object that's specified in the request. for more information, Configure Access to Amazon S3 For troubleshooting information, see Troubleshooting Amazon S3
    public static var invalidS3ObjectException: Self { .init(.invalidS3ObjectException) }
    /// An Amazon Textract service limit was exceeded. For example, if you start too many asynchronous jobs concurrently, calls to start operations (StartDocumentTextDetection, for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Textract service limit.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// The number of requests exceeded your throughput limit. If you want to increase this limit,  contact Amazon Textract.
    public static var provisionedThroughputExceededException: Self { .init(.provisionedThroughputExceededException) }
    ///  Returned when an operation tried to access a nonexistent resource.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// Returned when a request cannot be completed as it would exceed a maximum service quota.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// Amazon Textract is temporarily unable to process the request. Try your call again.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The format of the input document isn't supported. Documents for operations can be in PNG, JPEG, PDF, or TIFF format.
    public static var unsupportedDocumentException: Self { .init(.unsupportedDocumentException) }
    ///   Indicates that a request was not valid. Check request for proper formatting.
    public static var validationException: Self { .init(.validationException) }
}

extension TextractErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "AccessDeniedException": Textract.AccessDeniedException.self,
        "BadDocumentException": Textract.BadDocumentException.self,
        "ConflictException": Textract.ConflictException.self,
        "DocumentTooLargeException": Textract.DocumentTooLargeException.self,
        "HumanLoopQuotaExceededException": Textract.HumanLoopQuotaExceededException.self,
        "IdempotentParameterMismatchException": Textract.IdempotentParameterMismatchException.self,
        "InternalServerError": Textract.InternalServerError.self,
        "InvalidJobIdException": Textract.InvalidJobIdException.self,
        "InvalidKMSKeyException": Textract.InvalidKMSKeyException.self,
        "InvalidParameterException": Textract.InvalidParameterException.self,
        "InvalidS3ObjectException": Textract.InvalidS3ObjectException.self,
        "LimitExceededException": Textract.LimitExceededException.self,
        "ProvisionedThroughputExceededException": Textract.ProvisionedThroughputExceededException.self,
        "ResourceNotFoundException": Textract.ResourceNotFoundException.self,
        "ServiceQuotaExceededException": Textract.ServiceQuotaExceededException.self,
        "ThrottlingException": Textract.ThrottlingException.self,
        "UnsupportedDocumentException": Textract.UnsupportedDocumentException.self,
        "ValidationException": Textract.ValidationException.self
    ]
}

extension TextractErrorType: Equatable {
    public static func == (lhs: TextractErrorType, rhs: TextractErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension TextractErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
